home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / BBS-Archive / Comm / AmiTCP30b2.lha / src / rpclib / authunix_prot.c < prev    next >
C/C++ Source or Header  |  1994-03-09  |  3KB  |  86 lines

  1. /*
  2.  * $Id: authunix_prot.c,v 1.3 1994/03/09 01:35:23 jraja Exp $
  3.  *
  4.  * $Log: authunix_prot.c,v $
  5.  * Revision 1.3  1994/03/09  01:35:23  jraja
  6.  * Changed some xdr functions from int to long, since uids and gids are long.
  7.  *
  8.  * Revision 1.2  1993/11/10  01:21:16  jraja
  9.  * Fixed includes (added sys/param.h).
  10.  *
  11.  */
  12. /* @(#)authunix_prot.c    2.1 88/07/29 4.0 RPCSRC */
  13. /*
  14.  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
  15.  * unrestricted use provided that this legend is included on all tape
  16.  * media and as a part of the software program in whole or part.  Users
  17.  * may copy or modify Sun RPC without charge, but are not authorized
  18.  * to license or distribute it to anyone else except as part of a product or
  19.  * program developed by the user.
  20.  * 
  21.  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
  22.  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
  23.  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
  24.  * 
  25.  * Sun RPC is provided with no support and without any obligation on the
  26.  * part of Sun Microsystems, Inc. to assist in its use, correction,
  27.  * modification or enhancement.
  28.  * 
  29.  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
  30.  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
  31.  * OR ANY PART THEREOF.
  32.  * 
  33.  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
  34.  * or profits or other special, indirect and consequential damages, even if
  35.  * Sun has been advised of the possibility of such damages.
  36.  * 
  37.  * Sun Microsystems, Inc.
  38.  * 2550 Garcia Avenue
  39.  * Mountain View, California  94043
  40.  */
  41. #if !defined(lint) && defined(SCCSIDS)
  42. static char sccsid[] = "@(#)authunix_prot.c 1.15 87/08/11 Copyr 1984 Sun Micro";
  43. #endif
  44.  
  45. /*
  46.  * authunix_prot.c
  47.  * XDR for UNIX style authentication parameters for RPC
  48.  *
  49.  * Copyright (C) 1984, Sun Microsystems, Inc.
  50.  */
  51.  
  52.  
  53. #include <sys/param.h>
  54. #include <rpc/types.h>
  55. #include <rpc/xdr.h>
  56. #include <rpc/auth.h>
  57. #include <rpc/auth_unix.h>
  58.  
  59. /*
  60.  * XDR for unix authentication parameters.
  61.  */
  62. bool_t XDRFUN
  63. xdr_authunix_parms(xdrs, p)
  64.     register XDR *xdrs;
  65.     register struct authunix_parms *p;
  66. {
  67.  
  68.     if (xdr_u_long(xdrs, &(p->aup_time))
  69.         && xdr_string(xdrs, &(p->aup_machname), MAX_MACHINE_NAME)
  70. #ifdef AMITCP
  71.         && xdr_long(xdrs, &(p->aup_uid))
  72.         && xdr_long(xdrs, &(p->aup_gid))
  73.         && xdr_array(xdrs, (caddr_t *)&(p->aup_gids),
  74.             &(p->aup_len), NGRPS, sizeof(gid_t), xdr_long) ) {
  75. #else
  76.         && xdr_int(xdrs, &(p->aup_uid))
  77.         && xdr_int(xdrs, &(p->aup_gid))
  78.         && xdr_array(xdrs, (caddr_t *)&(p->aup_gids),
  79.             &(p->aup_len), NGRPS, sizeof(int), xdr_int) ) {
  80. #endif
  81.         return (TRUE);
  82.     }
  83.     return (FALSE);
  84. }
  85.  
  86.